# A tibble: 8 × 3
a b y
<fct> <fct> <dbl>
1 P P 0.9
2 P P 1.1
3 A P 2.9
4 A P 3.1
5 P B 3.9
6 P B 4.1
7 A B 9.9
8 A B 10.1
2025-02-18
# A tibble: 8 × 3
a b y
<fct> <fct> <dbl>
1 P P 0.9
2 P P 1.1
3 A P 2.9
4 A P 3.1
5 P B 3.9
6 P B 4.1
7 A B 9.9
8 A B 10.1
# A tibble: 8 × 6
a b i_a i_b i_ab y
<fct> <fct> <dbl> <dbl> <dbl> <dbl>
1 P P 0 0 0 0.9
2 P P 0 0 0 1.1
3 A P 1 0 0 2.9
4 A P 1 0 0 3.1
5 P B 0 1 0 3.9
6 P B 0 1 0 4.1
7 A B 1 1 1 9.9
8 A B 1 1 1 10.1
lm(y=a+b+a:b, data=hyp)lm(y=a*b, data=hyp)lm(y=i_a+i_b+i_ab, data=hyp_1)# A tibble: 4 × 2
term estimate
<chr> <dbl>
1 (Intercept) 1.00
2 i_a 2
3 i_b 3
4 i_ab 4
P P mean = 1A P mean = 1 + 2P B mean = 1 + 3A B mean = 1 + 2 + 3 + 4# A tibble: 4 × 3
child gender mean_trial4
<fct> <chr> <dbl>
1 Yes F 2.57
2 Yes M 2.54
3 No F 4.46
4 No M 6.77
# A tibble: 4 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <glue>
1 (Intercept) 2.57 0.382 6.73 p < 0.001
2 genderM -0.0343 0.516 -0.0666 p = 0.947
3 childNo 1.89 0.654 2.89 p = 0.005
4 genderM:childNo 2.35 0.815 2.88 p = 0.005
# A tibble: 2 × 7
term df.residual rss df sumsq statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl> <dbl> <glue>
1 loss ~ prog + hours_centered 896 43115. NA NA NA <NA>
2 loss ~ prog + hours_centered… 894 37795. 2 5319. 62.9 p < 0.…
# A tibble: 6 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <glue>
1 (Intercept) -3.70 0.376 -9.85 p < 0.001
2 progJogging 11.8 0.531 22.3 p < 0.001
3 progSwimming 29.6 0.531 55.7 p < 0.001
4 hours_centered -2.96 0.708 -4.18 p < 0.001
5 progJogging:hours_centered 10.4 1.07 9.71 p < 0.001
6 progSwimming:hours_centered 9.83 1.05 9.35 p < 0.001